package com.swy.shopgroup.controller;

import com.swy.shopgroup.entity.OutPage;
import com.swy.shopgroup.entity.PageAccept;
import com.swy.shopgroup.entity.Result;
import com.swy.shopgroup.service.OutPageService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/PageSend")
public class PageCtrlController {

    @Resource
    private OutPageService pageOutService;

    @RequestMapping(value = "/selectAll")
    @ResponseBody
    public Result selectAll() {
        return pageOutService.selectAll();
    }

    @RequestMapping(value = "/selectOutPageByShop")
    @ResponseBody
    public Result selectOutPageByShop(Long id) {
        return pageOutService.selectOutPageByShop(id);
    }

    @RequestMapping(value = "/insertOutPage")
    @ResponseBody
    public Result insertOutPage(OutPage outPage) {
        return pageOutService.insertOutPage(outPage);
    }

    @RequestMapping(value = "/selectAcceptByShop")
    @ResponseBody
    public Result selectAcceptByShop(Long id) {
        return pageOutService.selectAcceptByShop(id);
    }

    @RequestMapping(value = "/selectAcceptByUser")
    @ResponseBody
    public Result selectAcceptByUser(Long id) {
        return pageOutService.selectAcceptByUser(id);
    }

    @RequestMapping(value = "/insertAccept")
    @ResponseBody
    public Result insertAccept(PageAccept pageAccept) {
        return pageOutService.insertAccept(pageAccept);
    }
}
